fix: Use existing name to construct new file path based on extension#520
Open
juliusknorr wants to merge 1 commit intomainfrom
Open
fix: Use existing name to construct new file path based on extension#520juliusknorr wants to merge 1 commit intomainfrom
juliusknorr wants to merge 1 commit intomainfrom
Conversation
blizzz
reviewed
Feb 15, 2024
|
|
||
| if ($suggested[0] === '.') { | ||
| $path = dirname($file->getPath()) . '/New File' . $suggested; | ||
| $rawName = pathinfo($file->getName(), PATHINFO_FILENAME); |
Member
There was a problem hiding this comment.
If i understand correctly, X-WOPI-SuggestedTarget provides either a file name or a extension. Now in this case, when the provided string starts with a '.', pathinfo will always provide an empty string for PATHINFO_FILENAME, according to the documentation.
Unless a path is provided with this header, which is not what I understand it transports, but i would not exclude it entirely… but then a check would be missing.
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6dc8922 to
0bd7079
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should fix #236
Don't have a way to test right now as my office online server refuses to open doc files at all without meaningful error messages, but this should prevent an issue i've seen described where the file was stored as "New File.docx" and could then not be reopened when converting from doc to docx.